<!DOCTYPE html>
<html>
<head>
<title>SMM交易中心</title>
</head>

<body class="page-header-top-fixed">

<div class="page-header">
	<!--头部开始-->
	<#include "/include/top.html" />
	<!-- 头部信息结束 -->


	<!-- 头部菜单开始-->
	<#include "/include/top_menu.html" />
	<!-- 头部菜单结束 -->
</div>

<!-- 内容开始 -->
	<div class="portlet-body" style="padding-top: 10px">
		<div class="row">
			<div style="float: left;width: 80%;padding-left: 15px;">
				<div class="btn-group pull-left">
					<div class="row" style="height: 56px; text-align:left ;padding-left: 27px;padding-top: 8px;">
						<div class="col-sm-12">
							<div id="sample_2_filter" class="dataTables_filter">
							<div style="float: left;padding-left: 0px;padding-bottom: 7px;width: 500px;" class="col-md-6">
								<div class="btn-group btn-group-justified" > 
									<a href="${request.getContextPath()}/item/list.do" class="btn btn-default">分类设置</a>
									<a href="${request.getContextPath()}/price/list.do" class="btn btn-default">价格说明设置</a>
									<a href="${request.getContextPath()}/delivery/list.do" class="btn green">交货方式设置</a>
								</div>
							</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

		<div class="page-container">
			<div class="container-fluid">
			<div class="row margin-top-10">
			<div class="portlet light bordered">
				<div style="padding-left: 25px;">
				<div style="width: 39.3%">
					<div>
					
						<h3>添加交货方式</h3>
						<form action="${request.getContextPath()}/item/additem.do" method="post">
							<div style="width:180px;float:left;">
								<input type="text" name="name" id="name" value="" class="form-control">
							</div>
							
							<div style="width:80px;float:left;">
								<select name="isDomestic" id="isDomestic" class="form-control" style="margin-left: 5px;">
									<option value="1">国内</option>
									<option value="0">国外</option>
								</select>
							</div>
							
							<div style="width:180px;float:left;">
								<input type="button" onclick="add();" value="添加" class="btn green" style="margin-left: 10px;">			
							</div>
						</form>
						<br>
						<br>
						<h3>已添加的方式</h3>
						<table border="0" width="200px">
								<#list deliverys as delivery>
								<tr>
									<td align="left" width="80px">
									<#if delivery.id?? && delivery.id!=1 && delivery.id!=2 && delivery.id!=5>
										<a onclick="del(${delivery.id})" class="btn red">删除</a>
									</#if>
									</td>
									<td align="left" style="font-size: large;" width="90px">
										${delivery.name!'--'}
									</td>
									<td align="left" style="color: red">
										<#if delivery.isDomestic?? && delivery.isDomestic=0>
											国外
										<#else>
											国内
										</#if>
									</td>
								</tr>
								<tr height="5">
									<td>
									</td>
									<td>
									</td>
								</tr>
								</#list>
						</table>
					</div>
				</div>
				</div>
</div>
</div>
</div>


<!-- 底部开始 -->
<#include "/include/foot.html" />
<!-- 底部结束 -->
</body>

<link href="${request.getContextPath()}/Public/assets/admin/css/css.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/plugins.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/layout.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color">
<link href="${request.getContextPath()}/Public/assets/admin/css/custom.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/admin/css/common.css" rel="stylesheet" type="text/css">

<link rel="shortcut icon" href="${request.getContextPath()}/Public/favicon.ico">
<link href="${request.getContextPath()}/Public/css/client.css" rel="stylesheet" type="text/css">

<link href="${request.getContextPath()}/Public/assets/global/css/kkpager.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/css/customerDetail.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>

<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js" type="text/javascript"></script>
<script src="${request.getContextPath()}/Public/js/ckeditor/ckeditor.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
	Metronic.init(); // init metronic core componets
	Layout.init(); // init layout
	CommonUtils.checkInit();

});

function add(){
	if(confirm("是否确认添加？")){
		var name = $("#name").val();
		var isDomestic = $("#isDomestic").val();
		if(name==""){
			alert("请填写品类名称!");
			return false;
		}
		$.ajax({
			url : "${request.getContextPath()}/delivery/addDelivery.do",
			type : "post",
			dataType:"json",
			async: false,
			data : {"name":name,"isDomestic":isDomestic},
			success : function(result) {
			   if(result.code=="succ"){
				   CommonUtils.succModal2('系统提示',result.info,"${request.getContextPath()}/delivery/list.do");
				}else {
					CommonUtils.succModal('系统提示',result.info);
		   		}
			   }
		});
	}
}


function del(id){
	if(confirm("是否确认删除此品类？")){
		$.ajax({
			url : "${request.getContextPath()}/delivery/delDelivery.do",
			type : "post",
			dataType:"json",
			async: false,
			data : {"id":id},
			success : function(result) {
			   if(result.code=="succ"){
				   CommonUtils.succModal2('系统提示',result.info,"${request.getContextPath()}/delivery/list.do");
				}else {
					CommonUtils.succModal('系统提示',result.info);
		   		}
			   }
		});
	}
}
</script>

</html>